<script setup>
import { RouterView } from 'vue-router';
import { onMounted } from 'vue';

// 定义 Dify Chatbot 配置
window.difyChatbotConfig = {
  token: 'gq9EINwDoGsLLxNa',
  systemVariables: {
    // user_id: 'YOU CAN DEFINE USER ID HERE',
    // conversation_id: 'YOU CAN DEFINE CONVERSATION ID HERE, IT MUST BE A VALID UUID',
  },
};

onMounted(() => {
  // 动态创建并插入 Dify Chatbot 脚本
  const script = document.createElement('script');
  script.src = 'https://udify.app/embed.min.js';
  script.id = 'gq9EINwDoGsLLxNa';
  script.defer = true;
  document.body.appendChild(script);
});
</script>

<template>
  <RouterView />
</template>

<!-- 自定义聊天机器人悬浮按钮和窗口样式 -->
<style>
#dify-chatbot-bubble-button {
  background-color: #1C64F2 !important;
}
#dify-chatbot-bubble-window {
  width: 24rem !important;
  height: 40rem !important;
}
</style>


<style>
/* 全局样式 */
body {
  margin: 0;
  padding: 0;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #333;
}

/* 按钮基础样式 */
button {
  background: #1890ff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

button:hover {
  background: #40a9ff;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 16px;
  margin-bottom: 16px;
}
</style>
